package com.manpower.adapter;

import com.manpower.data.RegionalStatisticalData;
import com.manpower.ui.R;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

public class RegionalStatisticalItemView extends LinearLayout{
	
	private Context mContext;
	private TextView mTitle;
	private TextView mDetail;
	
	public RegionalStatisticalItemView(Context context, AttributeSet attrs) {
		super(context, attrs);
		initiate(context);
	}

	public RegionalStatisticalItemView(Context context) {
		super(context);
		initiate(context);
	}
	
	private void initiate(Context context) {
		mContext = context;
		View view = LayoutInflater.from(mContext).inflate(
				R.layout.regional_statistical_list_item, null);
		mTitle = (TextView) view.findViewById(R.id.title);
		mDetail = (TextView) view.findViewById(R.id.detail);
		addView(view);
	}
	
	public void updateView(RegionalStatisticalData data) {
		mTitle.setText(data.getmTitle());
		mDetail.setText(data.getmDetail());
	}
}
